package design.Day01;

import design.Day01.behavior.impl.FlyWithWings;
import design.Day01.behavior.impl.Quack;

/**
* @description: 鸭子测试类，策略类，动态选择
* @author: wangjun
* @create: 2022-01-07
*/
public class DuckMain {

    public static void main(String[] args) {
        Duck duck = new MallardDuck();
        duck.setFlyBehavior(new FlyWithWings());
        duck.setQuackBehavior(new Quack());
        duck.performFly();
        duck.performQuack();
        duck.display();
    }
}
